<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div
      class="outline-parent-bg border-hover-style"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style9/secondLevelStyle3Bg.webp'})`,
      }"
    >
      <div class="showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <div class="outline-content-left">
        <p class="title">{{ props.info.text }}</p>
      </div>
      <div class="outline-content-right" :class="{ 'null-sub-img': !props.info.value && !props.info.subTitle }">
        <p class="sub-title" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
        <div
          class="unit-img-box"
          :class="{ 'unit-img-box2': !props.info.remarks && !props.info.subTitle }"
          v-if="props.info.value"
        >
          <img
            @click="ImgVisible = true"
            :src="urls + props.info.value + '?imageView2/3/format/webp'"
            alt=""
            class="unit-img"
          />
        </div>
        <div class="remarks1" v-if="props.info.value && props.info.remarks">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="7"
          ></TextMax>
        </div>
        <div class="remarks2" v-else-if="props.info.remarks">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="14"
          />
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
export default defineComponent({
  name: 'free9Style3',
});
</script>
<script lang="ts" setup>
import { publicUrls } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style9.vue';
import textMode from '../../../textMode/textMode.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax9.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();

const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style lang="less" scoped>
.outline-parent {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-right: 160px;
}
.outline-parent-bg {
  position: relative;
  width: 520px;
  height: 774px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: flex;
  // justify-content: space-between;
}
.showroom-parent {
  position: absolute;
  bottom: 94px;
  left: 25px;
  z-index: 21;
  width: 40px;
  height: 40px;
}
.outline-content-left {
  flex-shrink: 0;
  width: 84px;
  height: 624px;
  margin-left: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.title {
  color: #8a7a6a;
  letter-spacing: 10px;
  text-align: center;
  text-shadow: 0px 0px 1px #fff9ef;
  /* 二级标题 */
  font-family: 'SourceHanSerifCN';
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  line-height: 36px; /* 150% */
  writing-mode: vertical-rl;
}
.outline-content-right {
  flex-shrink: 0;
  width: 402px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 59px 30px 140px 40px;
}
.sub-title {
  width: 320px;
  color: #8a7a6a;

  text-align: center;
  /* 二级副标 */
  font-family: 'SourceHanSerifCN';
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: 28px; /* 155.556% */
}
.unit-img-box {
  flex-shrink: 0;
  width: 320px;
  height: 248px;
  margin-top: 24px;
}
.unit-img-box2 {
  flex: 1;
  margin: 0;
}
.unit-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #dcceb9;
}
.remarks1 {
  flex-shrink: 0;
  width: 320px;
  margin-top: 24px;
}
.remarks2 {
  flex-shrink: 0;
  width: 320px;
  margin-top: 40px;
}
.null-sub-img {
  justify-content: flex-end;
}
</style>
